package com.hankz.cc.leetcode;

/**
 * @auther zzc
 * @date 2021/3/23 18:09
 */
public class 只出现一次的数字 {

    public static void main(String[] args) {
        int[] array = new int[]{1, 2, 3, 1, 2, 3, 4, 5, 5};
        System.out.println(getResNum(array));
    }

    private static int getResNum(int[] array) {
        int res = 0;
        for (int num : array) {
            res ^= num;
        }
        return res;
    }
}
